const express = require('express')
const apiRouter = express.Router();
const navData = require('./nav.json')

console.log(navData)
//挂载对应得路由
apiRouter.get('/get', (req, res) => {
  //获取到客户端通过查询字符串，发送到服务器得数据
  const query = req.query
  res.send({
    status:200,
    msg: 'success',
    data: query
  })
})
apiRouter.get('/get_nav', (req, res) => {
  res.send({
    status:200,
    message:'success',
    data:navData
  })
})
apiRouter.post('/add', (req, res) => {
  const body = req.body;
  res.send({
    status:200,
    msg: 'success',
    data: body
  })
})
apiRouter.delete('/delete', (req, res) => {
  res.send({
    status:200,
    msg: 'success'
  })
})
module.exports = apiRouter